How to run VPS project locally?

If you don't want to run the VPS project locally, you can skip this section.

VPS-project

These things are required, to run the project.

Installing Docker and Docker Compose in Windows

Here are the steps to install Docker on Windows:

  1. Download the Docker Desktop for Windows installer from the Docker website.
  2. Double-click the downloaded file to start the installation process.
  3. Click "Yes" when prompted by the User Account Control dialog to allow the installer to make changes to your system.
  4. Follow the instructions on the screen to complete the installation process. The installer will install Docker Desktop on your system and set it up to run as a Windows service.
  5. Once the installation is complete, click the "Finish" button to close the installer.
  6. Open the Start menu and search for "Docker Desktop". Click on the Docker Desktop application to launch it.
  7. Once Docker Desktop is running, you can use the Docker CLI to interact with your containers. You can also use the Docker Desktop Dashboard to manage your containers and images.
  8. Docker Desktop for Windows includes Docker Compose as part of the installation, so you don't have to install it separately.
  9. To verify that Docker Compose is installed and available, you can open a Command Prompt or PowerShell window and run the following command:
  10. docker-compose --version

Note: Your system must meet the minimum hardware and software requirements to run Docker Desktop, including Windows 10 64-bit Pro, Enterprise, or Education, version 2004 or later.

Installing Docker and Docker Compose in macOS

Here are the steps to install Docker Desktop for macOS:

  1. Download Docker Desktop for macOS from the Docker website.
  2. Double-click the downloaded file to start the installation process.
  3. Follow the instructions in the installation wizard to complete the installation.
  4. Once the installation is complete, open the Docker application from the Applications folder or from Launchpad.
  5. Wait for the Docker icon to appear in the status bar.
  6. Click the Docker icon in the status bar to open the Docker application.
  7. Verify that Docker is installed and running by running the following command in a Terminal window:
  8. Now you can use Docker to manage containers and images on your macOS system. Note that Docker Compose is included with the Docker Desktop for macOS installation, so you do not need to install it separately.
  9. docker-compose --version

Installing Docker and Docker Compose in Linux

Here are the steps to install Docker and Docker Compose on a Linux distribution such as Ubuntu:

  1. Install Docker:
  2. sudo apt-get update
    sudo apt-get install docker.io
  3. Start the Docker service:
  4. sudo systemctl start docker
  5. Verify that Docker is installed and running by running the following command:
  6. docker run hello-world
  7. Install Docker Compose:
  8. sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
  9. Verify that Docker Compose is installed and available by running the following command:
  10. docker-compose --version
  11. Now you can use Docker to manage containers and images, and use Docker Compose to manage multi-container Docker applications on your Linux distribution.

IP address in Windows

You wii be needing the IP Address of your PC to configure the project.

You can get the IP address of your Windows system using the following steps:

  1. Click the Windows Start button and type "cmd" in the search box.
  2. Right-click the Command Prompt icon and select "Run as administrator".
  3. In the Command Prompt window, type the following command and press Enter:
  4. ipconfig
  5. The output will show the IP addresses assigned to your system. You may see multiple lines if your system has multiple network interfaces. The IP address listed under the "IPv4 Address" or "IP Address" header is the IP address for the interface.
  6. If you are using a Wi-Fi connection, you may also find the IP address listed as the "Default Gateway" under the "Wireless LAN adapter Wi-Fi" section.

IP address in macOS

You can get the IP address of your macOS system using the following steps:

  1. Open the Terminal application (you can find it in the Utilities folder within the Applications folder).
  2. Type the following command and press Enter:
  3. ifconfig | grep "inet " | grep -v 127.0.0.1
  4. The output will show the IP addresses assigned to your system. You may see multiple lines if your system has multiple network interfaces. The IP address listed under the "inet" header is the IP address for the interface.
  5. Note: The above command will only work for macOS systems running macOS Mojave (10.14) or earlier. If you are running a later version of macOS, you can use the following command instead:
  6. ipconfig getifaddr en0
  7. Replace "en0" with the name of the network interface you want to get the IP address for.

IP address in Linux

You can get the IP address of your Linux system using the following steps:

  1. Open a Terminal window.
  2. Type the following command and press Enter:
  3. ifconfig
  4. The output will show the IP addresses assigned to your system. You may see multiple lines if your system has multiple network interfaces. The IP address listed under the "inet" header is the IP address for the interface.
  5. Note: If the "ifconfig" command is not available on your system, you can try using the "ip" command instead:
  6. ip addr show
  7. This will show the IP addresses assigned to your system, along with other information about your network interfaces. The IP address is listed under the "inet" header.

Project Configuration

  1. Navigate to the root directory of VPS-project folder.
  2. Go to frontend folder
  3. Open config.json file in a text editor.
  4. Change the value of apiBase. Put here the IP Address with Port: 81. eg. http://192.168.0.104:81/
  5. Now Navigate to the root directory of VPS-project folder.
  6. Go to backend folder
  7. Open .env file in a text editor.
  8. Change the value of APP_URL to http://127.0.0.1:81
  9. Also, Change the value of CLIENT_BASE_URL to http://127.0.0.1

Run the Project

  1. Navigate to the root directory of VPS-project folder using the terminal.
  2. Make sure docker compose is running by running the following command:
  3. docker-compose --version
  4. Run the following command to build the docker container:
  5. docker-compose build --no-cache
  6. Run the following command to start docker container:
  7. docker-compose up -d
  8. Now its time to run the database migrations in the backend. Please Run the following command to start to go to the app image:
  9. docker-compose exec app bash
  10. Please Clear the cache by running these commands:
  11. php artisan route:cache
    php artisan route:clear
    php artisan config:cache
    php artisan config:clear
    php artisan cache:clear
    php artisan optimize
  12. Run the migration by running these commands:
  13. php artisan migrate:fresh --seed
    php artisan passport:install
  14. Please Clear the cache one last time by running the commands above (Step: 6).
  15. Now, Exit from the image by running:
  16. exit
  17. Now, run the following command to stop the docker container:
  18. docker-compose down
  19. Run the following command to start docker container:
  20. docker-compose up -d
  21. You can access the website from the IP address in the browser now. eg. http://192.168.0.104
  22. You can access the admin panel from the IP address with Port: 81. eg. http://192.168.0.104:81/
  23. Use these credentials below to login to the admin panel
    • Admin email: admin@mail.com
    • Admin password: 123456

We've attached a video here. You can check that out.